<script setup lang="ts">

import {computed, defineComponent} from "vue";

const props = defineProps({
  text: String,
  code: String
})


defineComponent({
  name: 'icon',
})

const iconFont = computed(() => {
  return '#icon-' + props.code
})
</script>

<template>
  <div class="text">
    <svg class="icon" aria-hidden="true">
      <use :xlink:href="iconFont"></use>
    </svg>
    {{ text }}
  </div>
</template>

<style scoped>
.icon {
  width: 20px;
  height: 20px;
  vertical-align: -5px;
}

</style>
